Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class GetUserProfilePhotosAction(userId: Long, offset: Int? = null, limit: Int? = null) : SimpleAction<UserProfilePhotos>
Link copied to clipboard
class SendInvoiceAction(title: String, description: String, payload: String, providerToken: String? = null, currency: Currency, prices: List<LabeledPrice>) : Action<Message> , OptionsFeature<SendInvoiceAction, InvoiceOptions> , MarkupFeature<SendInvoiceAction>
Link copied to clipboard
class SetMessageReactionAction(messageId: Long, reaction: List<ReactionType>? = null, isBig: Boolean? = null) : Action<Boolean>
Link copied to clipboard

Functions

Link copied to clipboard
inline fun contact(firstName: String, phoneNumber: String): SendContactAction

Use this method to send phone contacts. On success, the sent Message is returned.

Link copied to clipboard
inline fun dice(emoji: String? = null): SendDiceAction
Link copied to clipboard
inline fun game(gameShortName: String): SendGameAction
Link copied to clipboard
inline fun getFile(fileId: String): GetFileAction

Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot/, where is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again. Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.

Link copied to clipboard
inline fun getGameHighScores(user: User, messageId: Long): GetGameHighScoresAction

inline fun getGameHighScores(userId: Long, messageId: Long): GetGameHighScoresAction

Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of GameHighScore objects.

Link copied to clipboard

Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.

Link copied to clipboard
inline fun getUserProfilePhotos(user: User, offset: Int? = null, limit: Int? = null): GetUserProfilePhotosAction

inline fun getUserProfilePhotos(userId: Long, offset: Int? = null, limit: Int? = null): GetUserProfilePhotosAction

Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.

Link copied to clipboard
inline fun invoice(title: String, description: String, payload: String, providerToken: String? = null, currency: Currency, prices: List<LabeledPrice>): SendInvoiceAction

Use this method to send invoices. On success, the sent Message is returned.

inline fun invoice(title: String, description: String, providerToken: String? = null, currency: Currency, vararg prices: LabeledPrice, payload: () -> String): SendInvoiceAction
Link copied to clipboard
inline fun location(latitude: Float, longitude: Float): SendLocationAction
Link copied to clipboard
inline fun poll(question: String, vararg options: InputPollOption): SendPollAction
fun poll(question: String, options: PollOptionsBuilder.() -> Unit): SendPollAction

inline fun poll(question: String, options: List<InputPollOption>): SendPollAction

Use this method to send a native poll. On success, the sent Message is returned.

Link copied to clipboard
inline fun sendContact(firstName: String, phoneNumber: String): SendContactAction
Link copied to clipboard
inline fun sendDice(emoji: String? = null): SendDiceAction

Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

Link copied to clipboard
inline fun sendGame(gameShortName: String): SendGameAction

Use this method to send a game. On success, the sent Message is returned.

Link copied to clipboard
inline fun sendInvoice(title: String, description: String, payload: String, providerToken: String? = null, currency: Currency, prices: List<LabeledPrice>): SendInvoiceAction
Link copied to clipboard
inline fun sendLocation(latitude: Float, longitude: Float): SendLocationAction

Use this method to send point on the map. On success, the sent Message is returned.

Link copied to clipboard
fun sendPoll(question: String, options: PollOptionsBuilder.() -> Unit): SendPollAction
Link copied to clipboard
inline fun sendVenue(latitude: Float, longitude: Float, title: String, address: String): SendVenueAction
Link copied to clipboard
inline fun setGameScore(user: User, score: Long): SetGameScoreAction
inline fun setGameScore(userId: Long, score: Long): SetGameScoreAction
inline fun setGameScore(user: User, messageId: Long, score: Long): SetGameScoreAction

inline fun setGameScore(userId: Long, messageId: Long, score: Long): SetGameScoreAction

Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.

Link copied to clipboard
inline fun setMessageReaction(messageId: Long, vararg reaction: ReactionType, isBig: Boolean? = null): SetMessageReactionAction
fun setMessageReaction(messageId: Long, isBig: Boolean? = null, reaction: ListingBuilder<ReactionType>.() -> Unit): SetMessageReactionAction

inline fun setMessageReaction(messageId: Long, reaction: List<ReactionType>? = null, isBig: Boolean? = null): SetMessageReactionAction

Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.

Link copied to clipboard
Link copied to clipboard

Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.

Link copied to clipboard

Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.

Link copied to clipboard
inline fun stopPoll(messageId: Long): StopPollAction

Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.

Link copied to clipboard
inline fun venue(latitude: Float, longitude: Float, title: String, address: String): SendVenueAction

Use this method to send information about a venue. On success, the sent Message is returned.